package com.iplus.ydkf.ehome.common.net;

import com.alibaba.fastjson.JSONObject;

import java.io.IOException;

import okhttp3.Response;

/**
 * Created by lhtde on 2016/6/5.
 */
public class JsonParser<T> implements Parser<JSONObject> {
    @Override
    public JSONObject parse(Response response) {
        JSONObject result = null;
        try {
            result = JSONObject.parseObject(response.body().string());
        } catch (IOException e) {
            e.printStackTrace();
        }
        return result;
    }

    public static Parser getInstance() {
        return new JsonParser<>();
    }
}
